<template>
	<view class="mainbgc mainpadding2">
		<!-- 发布求职 -->
		<view class="strongtext">
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext minwidth">产地</view>
				<view class="flexright">
					<input type="text" placeholder="请输入商品产地" class="textright margin_right" v-model="dataAll.cd">
				</view>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext minwidth">自重量（KG）</view>
				<view class="flexright">
					<input type="text" placeholder="请输入商品重量" class="textright margin_right" v-model="dataAll.zsl">
				</view>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext minwidth">材质</view>
				<view class="flexright">
					<input type="text" placeholder="请输入商品材质" class="textright margin_right" v-model="dataAll.cz">
				</view>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext">结构</view>
				<input type="text" placeholder="请设置商品结构" class="textright margin_right" v-model="dataAll.jg"></input>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext">承重</view>
				<input type="text" placeholder="请设置商品承重" class="textright margin_right"
					v-model="dataAll.cweigh"></input>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext">成色</view>
				<input type="text" placeholder="请设置商品成色" class="textright margin_right" v-model="dataAll.cs"></input>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext">最少起售量</view>
				<input type="text" placeholder="请输入数量" class="textright margin_right" v-model="dataAll.min_qsl"></input>
			</view>
			<view class="mainpadding_top ffffff radius">
				<view class="flexbetween">
					<view class="strongtext">其他属性</view>
					<view class="strongtext" style="color: #248fff;" @click="addshuxing">添加</view>
				</view>
				<view class="mainpadding radius margin_top" style="background-color: #f7f7f7;" v-for="(item,index) in dataAll.other_sx" :key="index">
					<input type="text" placeholder="请输入标题" v-model="item.title"></input>
					<view class="flexbetween">
						<input type="text" placeholder="请输入描述" class="margin_top" v-model="item.des"></input>
						<u-icon name="trash" @click="delshuxing(index)"></u-icon>
					</view>
				</view>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext">存货地</view>
				<input type="text" placeholder="请输入商品存货地址" class="textright margin_right" v-model="dataAll.chd"></input>
			</view>
			<view class="mainpadding_top ffffff radius flexbetween">
				<view class="strongtext">物流方式</view>
				<input type="text" placeholder="请输入物流方式" class="textright margin_right" v-model="dataAll.flfs"></input>
			</view>
			<view class="mainpadding_top ffffff radius ">
				<view class="strongtext">其他说明</view>
				<textarea type="text" placeholder="请您对商品进行其他说明" maxlength="600" class="margin_top" v-model="dataAll.qtsm"></textarea>
			</view>
			<view class="bottombtn margin_top" @click="submit()">保存</view>
		</view>
	</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				dataAll: {
					cd: "",
					zsl: "",
					cz: "",
					jg: "",
					cweigh: "",
					cs: "",
					min_qsl: "",
					chd: "",
					flfs: "",
					qtsm: "",
					other_sx:[]
				}
			}
		},
		onLoad(options) {
			let data = JSON.parse(decodeURIComponent(options.msg));
			this.dataAll = data
		},
		methods: {
			submit(){
				uni.$emit("spsx",this.dataAll)
				uni.navigateBack(1)
			},
			addshuxing(){
				
				this.dataAll.other_sx.push({title:"",des:""})
			},
			delshuxing(index){
				this.dataAll.other_sx.splice(index,1)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.form {
		text-align: center;
		padding-top: 54rpx;
		padding-bottom: 61rpx;
	}

	.pu {
		background: RGBA(247, 249, 250, 1);
		border-radius: 41rpx 41rpx 41rpx 41rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
		padding: 20rpx 71rpx 21rpx 71rpx;
		margin: 0rpx 25rpx 30rpx 25rpx;
	}

	.footer {
		padding: 84rpx 30rpx;
	}

	.nav {
		padding: 30rpx 10rpx;
	}

	.upbox {
		width: 180rpx;
		height: 180rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
		background-color: RGBA(233, 244, 255, 1);
	}

	.lan {
		background: RGBA(233, 244, 255, 1);
		border-radius: 41rpx 41rpx 41rpx 41rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #228DFF;
		padding: 20rpx 71rpx 21rpx 71rpx;
		margin: 0rpx 25rpx 30rpx 25rpx;
	}

	.itemlable {
		padding: 15rpx 35rpx;
		border-radius: 10rpx;
	}

	.mainbgc {
		overflow: hidden;
	}

	.focusbgc {
		background-color: rgba(34, 141, 255, .1);
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #228DFF;
	}

	.nofocusbgc {
		background-color: #EFEFEF;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
	}

	.item_image_box {
		width: 33.33%;
	}

	.item_image {
		position: relative;
		width: 180rpx;
		height: 180rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.video {
		width: 180rpx;
		height: 180rpx;
	}

	// 分类列表滚动
	.leftscroll {
		height: 500rpx;
		width: 200rpx;
	}

	.itemfocus {
		background-color: #fafafa;
		padding: 25rpx 0 25rpx 20rpx;
	}

	.lablefocus {
		font-size: 30rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #228DFF;
		text-align: center;
		border-left: 2rpx solid #228DFF;
		width: 100rpx;
		padding-left: 10rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.itemnofocus {
		background-color: #fff;
		padding: 25rpx 0 25rpx 20rpx;
	}

	.lablenofocus {
		font-size: 30rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #666666;
		text-align: center;
		padding-left: 10rpx;
		width: 100rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.rightscroll {
		width: calc(100vw - 200rpx);
		background-color: #fafafa;
		height: 500rpx;
		box-sizing: border-box;
	}

	// 分类列表滚动结束
</style>